import request from '@/utils/request'

export function all(params) {
    return request({
        url: '/vote/all',
        method: 'get',
        params: {
            page: params.page,
            pageSize: params.pageSize,
            title: params.title
        }
    })
}

export function info(params) {
    return request({
        url: '/vote/info',
        method: 'get',
        params: {
            id: params.id
        }
    })
}

export function save(data) {
    return request({
        url: '/vote/save',
        method: 'post',
        data: data
    })
}

export function publish(data) {
    return request({
        url: '/vote/publish',
        method: 'post',
        data: data
    })
}

export function vote(data) {
    return request({
        url: '/vote/vote',
        method: 'post',
        data: data
    })
}

export function result(params) {
    return request({
        url: '/vote/result',
        method: 'get',
        params: {
            id: params.id
        }
    })
}